/* jshint esversion: 6 */
import Router from 'vue-router'
import Vue from 'vue'

Vue.use(Router)

let defaultRouter = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/Home'),
        children: [
            {
                path: '/system',
                name: 'system',
                component: () => import('../views/system/System'),
                children: [
                    {
                        path: 'user',
                        name: 'user',
                        component: () => import('../views/system/User')
                    },
                    {
                        path: 'setting',
                        name: 'setting',
                        component: () => import('../views/system/Setting')
                    }
                ]
            },
            {
                path: '/apply',
                name: 'apply',
                component: () => import('../views/apply/Apply'),
                children:[
                    {
                        path: 'leave',
                        name: 'leave',
                        component: () => import('../views/apply/Leave')
                    },
                    {
                        path: 'outgoing',
                        name: 'outgoing',
                        component: () => import('../views/apply/Outgoing')
                    },
                    {
                        path: 'scholarship',
                        name: 'scholarship',
                        component: () => import('../views/apply/Scholarship')
                    }
                ]
            },
            {
                path: '/test',
                name: 'test',
                component: () => import('../views/Test'),
            }
        ]
    },
]

let route = new Router({
    mode: 'history',
    routes: defaultRouter
})

export default route

